// 导入变量
@import './variables.scss';
@import './mixins.scss';

// 全局样式重置
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--el-text-color-primary);
  background-color: var(--el-bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// 工具类
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-column {
  display: flex;
  flex-direction: column;
}

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }
.ml-5 { margin-left: 20px; }

.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }
.mr-5 { margin-right: 20px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

// 卡片样式
.card {
  background: var(--el-bg-color);
  border: 1px solid var(--el-border-color);
  border-radius: var(--el-border-radius-base);
  padding: 20px;
  box-shadow: var(--el-box-shadow-light);
  transition: box-shadow 0.3s;

  &:hover {
    box-shadow: var(--el-box-shadow);
  }
}

// 页面容器
.page-container {
  padding: 20px;
  min-height: calc(100vh - 60px);
}

.page-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--el-border-color-lighter);

  .title {
    font-size: 20px;
    font-weight: 600;
    color: var(--el-text-color-primary);
    margin: 0;
  }

  .description {
    font-size: 14px;
    color: var(--el-text-color-regular);
    margin: 4px 0 0 0;
  }
}

// 表格样式增强
.el-table {
  .el-table__header-wrapper {
    th {
      background-color: var(--el-fill-color-light);
      font-weight: 600;
    }
  }
}

// 表单样式增强
.el-form {
  .el-form-item__label {
    font-weight: 500;
  }
}

// 按钮组样式
.button-group {
  display: flex;
  gap: 8px;
  align-items: center;

  &.right {
    justify-content: flex-end;
  }

  &.center {
    justify-content: center;
  }
}

// 状态标签
.status-tag {
  &.success {
    color: var(--el-color-success);
    background-color: var(--el-color-success-light-9);
    border-color: var(--el-color-success-light-7);
  }

  &.warning {
    color: var(--el-color-warning);
    background-color: var(--el-color-warning-light-9);
    border-color: var(--el-color-warning-light-7);
  }

  &.danger {
    color: var(--el-color-danger);
    background-color: var(--el-color-danger-light-9);
    border-color: var(--el-color-danger-light-7);
  }

  &.info {
    color: var(--el-color-info);
    background-color: var(--el-color-info-light-9);
    border-color: var(--el-color-info-light-7);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .page-container {
    padding: 16px;
  }

  .button-group {
    flex-direction: column;
    align-items: stretch;

    .el-button {
      width: 100%;
    }
  }
}

// 暗色模式适配
html.dark {
  .card {
    box-shadow: var(--el-box-shadow-dark);
  }
}